package cn.edu.ptu.jobfairs.basic.enums;

/**
 * @author wutingting.226@163.com
 * @date 2020/8/30
 */

public enum InterviewStatus {
    //0提交 1待面试 -1拒绝面试 2面试通过 -2面试失败 -3对方拒绝面试
    SUBMIT(0, "提交"),
    TO_BE_INTERVIEWED(1, "待面试"),
    REFUSE_TO_INTERVIEW(-1, "拒绝面试"),
    INTERVIEW_SUCCESS(2, "面试通过"),
    INTERVIEW_FAILED(-2, "面试失败"),
    CANDIDATE_REFUSED(-3, "对方拒绝面试");

    private final int value;

    InterviewStatus(int value, String desc) {
        this.value = value;
    }

    public static InterviewStatus of(Integer value) {
        if (value == null) return null;
        for (InterviewStatus interviewStatus : values()) {
            if (interviewStatus.value == value) return interviewStatus;
        }
        return null;
    }

    public static boolean exists(Integer value) {
        if (value == null) return false;
        for (InterviewStatus interviewStatus : values()) {
            if (interviewStatus.value == value) return true;
        }
        return false;
    }

    public int getValue() {
        return value;
    }
}
